package com.huaju.enity;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;

import static javax.persistence.GenerationType.IDENTITY;

import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

/**
 * Incometype entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "incometype", catalog = "licai")
@JsonIgnoreProperties(value={"incomelists"})
public class Incometype implements java.io.Serializable {

	// Fields

	private Integer tid;
	private String tname;
	private Set<Incomelist> incomelists = new HashSet<Incomelist>(0);

	// Constructors

	/** default constructor */
	public Incometype() {
	}

	/** full constructor */
	public Incometype(String tname, Set<Incomelist> incomelists) {
		this.tname = tname;
		this.incomelists = incomelists;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "tid", unique = true, nullable = false)
	public Integer getTid() {
		return this.tid;
	}

	public void setTid(Integer tid) {
		this.tid = tid;
	}

	@Column(name = "tname")
	public String getTname() {
		return this.tname;
	}

	public void setTname(String tname) {
		this.tname = tname;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "incometype")
	public Set<Incomelist> getIncomelists() {
		return this.incomelists;
	}

	public void setIncomelists(Set<Incomelist> incomelists) {
		this.incomelists = incomelists;
	}

}